package com.enjoyor.soa.traffic.api.dto.vms;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
* @ClassName: TreeNodeDto
* @Description: 树结构实体类.
* @author yrch  961774545@qq.com
* @date 2016年4月19日 上午8:59:19 
*
 */
public class TreeNodeDto implements Serializable {
    /**
     * 
     * <p>
     * Title: 构造函数
     * </p>
     * <p>
     * Description: 实例化EasyUI Tree Node
     * </p>
     */
    public TreeNodeDto()
    {
    }
    
    /**
     * <p>
     * Title: 构造函数
     * </p>
     * <p>
     * Description: 实例化EasyUI Tree Node
     * </p>
     * 
     * @param id 节点的 id
     * @param text 要显示的节点文本
     * @param state 节点状态，'open' 或 'closed'
     * @param checked 指示节点是否被选中
     * @param attributes 给一个节点添加的自定义属性
     */
    public TreeNodeDto(String id, String text, String state, Boolean checked, Object attributes)
    {
        this.id = id;
        this.text = text;
        this.state = state;
        this.checked = checked;
        this.attributes = attributes;
    }
    public TreeNodeDto(String id, String text, String state, Boolean checked, Object attributes, String iconCls)
    {
        this.id = id;
        this.text = text;
        this.state = state;
        this.checked = checked;
        this.attributes = attributes;
        this.iconCls = iconCls;
    }
    /**
     * @Title: Append
     * @Description: 添加子节点
     * @param node 子节点
     * @throws
     */
    public void Append(TreeNodeDto node)
    {
        this.children.add(node);
    }
    
    /**
     * 节点的 id
     */
    private String id;
    
    /**
     * 要显示的节点文本
     */
    private String text;
    
    /**
     * 节点状态，'open' 或 'closed'
     */
    private String state;
    
    /**
     * 指示节点是否被选中
     */
    private Boolean checked;
    
    /**
     * 给一个节点添加的自定义属性
     */
    private Object attributes;
    
    /**
     * 定义了一些子节点的节点数组
     */
    private String iconCls;
    
    private List<TreeNodeDto> children = new ArrayList<TreeNodeDto>();
    
    public String getId()
    {
        return id;
    }
    
    public void setId(String id)
    {
        this.id = id;
    }
    
    public String getText()
    {
        return text;
    }
    
    public void setText(String text)
    {
        this.text = text;
    }
    
    public String getState()
    {
        return state;
    }
    
    public void setState(String state)
    {
        this.state = state;
    }
    
    public Boolean getChecked()
    {
        return checked;
    }
    
    public void setChecked(Boolean checked)
    {
        this.checked = checked;
    }
    
    public Object getAttributes()
    {
        return attributes;
    }
    
    public void setAttributes(Object attributes)
    {
        this.attributes = attributes;
    }
    
    public List<TreeNodeDto> getChildren()
    {
        return children;
    }
    
    public void setChildren(List<TreeNodeDto> children)
    {
        this.children = children;
    }

	/**
	 * @return the iconCls
	 */
	public String getIconCls() {
		return iconCls;
	}

	/**
	 * @param iconCls the iconCls to set
	 */
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
}
